home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / UUPC3 / (UUPC__) / MACINIT.C < prev    next >
Text File  |  1992-02-10  |  1KB  |  53 lines

  1. /*            macinit.c
  2.  
  3.             Portions Copyright ⌐ David Platt, 1992, 1991.  All Rights Reserved
  4.             Worldwide.
  5.  
  6. */
  7.  
  8. #ifdef THINK_C
  9. # include "unixlibproto.h"
  10. #endif THINK_C
  11.  
  12. #include "dcp.h"
  13.  
  14. #include    <stdio.h>
  15.  
  16. macinit()
  17. {
  18.     WindowPeek theWindow;
  19.     int consoleDriverRefNum;
  20.     DCtlHandle consoleDriverHandle;
  21.     /* standard initialization required by real Mac applications */
  22.     InitGraf(&thePort);
  23.     InitWindows();
  24.     InitFonts();
  25.     FlushEvents(everyEvent,0);
  26.     InitMenus();                /* init menu manager */
  27.     InitDialogs((ProcPtr) 0L);    /* init dialog manager */
  28.     TEInit();                    /* init text edit */
  29.     InitCursor();
  30.     MaxApplZone();
  31. /*
  32.     That which follows, makes my skin crawl and my gorge rise.  I
  33.     hate doing things like this.  Ne'ertheless, it seems to be
  34.     necessary to keep the THINK C console driver from eating all
  35.     keyclicks which take place when its window is foremost.  The
  36.     behavior of the driver is appropriate for I/O consoles, but
  37.     is inappropriate for output-only consoles such as the one
  38.     that UUPC uses.
  39. */
  40.     printf("Welcome to uupc!\n\n");
  41.     theWindow = stdout->window;
  42.     consoleDriverRefNum = theWindow->windowKind;
  43.     consoleDriverHandle = GetDCtlEntry(consoleDriverRefNum);
  44.     if (consoleDriverHandle) {
  45.         (**consoleDriverHandle).dCtlEMask &= 0xFFF7; /* turn off key-down event grab */
  46.     }
  47. /*
  48.     Forgive me, for I have sinned.
  49.             dplatt@snulbug.mtview.ca.us
  50. */
  51. }
  52.  
  53.